Apparatus for reading a document and processing the image

ABSTRACT

An image processing system characterized by recognizing a document area and binarizing an image data read from a document based on an image data read from the recognized document area.

This application is a division of application Ser. No. 07/700,993 filedMay 10, 1991 now U.S. Pat. No. 5,086,486, which was a continuation ofapplication Ser. No. 07/570,971, filed on Aug. 22, 1990, now abandoned,which was a continuation of application Ser. No. 07/205,575, nowabandoned, filed on Jun. 10, 1988, which was a continuation ofapplication Ser. No. 06/775,013, filed on Sep. 11, 1985, now abandoned.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image processing system, and moreparticularly to a document image processing system.

2. Description of the Prior Art

In a binary processing system for an image signal, a document sheet isprescanned to detect a document density or determine a slicing level forbinarization in order to binarize the read image signal based on thedetected result. In one prior art system, the slicing level isdetermined based on information including unnecessary information onother than a document area on a document sheet table. As a result,genuine optimization is not attained. In another prior art system, theslicing level is determined based on an average document level or thebackground level. In this method too, an optimum binarization is notattained.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide an image processingsystem which can attain an image of a proper image quality.

It is another object of the present invention to provide an imageprocessing system which carries out processing based on necessary andeffective image information in a document area.

It is another object of the present invention to provide an imageprocessing system which detects a predetermined data read level andcarries out processing based on a frequency of occurrence of such leveldetection.

It is another object of the present invention to provide an imageprocessing system which can shorten preparative time for processing aread image.

It is another object of the present invention to provide a documentimage processing system which can detect a size of a document sheet anda frequency of occurrence of detection of a predetermined documentdensity level.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic view of a document reader,

FIG. 2 is a block diagram of an image signal processing circuit,

FIG. 3 shows a relationship between a document sheet placed on adocument sheet table and position coordinates,

FIG. 4 shows a position coordinate detection circuit,

FIG. 5 is a flow chart of an image read sequence,

FIG. 6 shows a relationship between a document position and an operationsequence,

FIGS. 7a-b show a black peak histogram and a white peak histogram, and

FIG. 8 is a schematic view of another document reader.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 shows a schematic view of a document reader to which the presentinvention is applied. In order to read image information of a document102 placed on a document sheet table 101 and pressed by a document sheetcover 110, a line image pickup device 103 such as a CCD is used, andillumination light from a light source 104 is reflected by the surfaceof the document 102 and focused onto the image pickup device 103 by alens 108 through mirrors 105, 106 and 107. The light source 104 and themirror 105 are moved at a predetermined speed and the mirrors 106 and107 are moved at one-half that speed. This optical unit is moved fromleft to right at a constant velocity by a DC servo motor 109 under a PLLcontrol. This velocity is variable between 90 mm/sec and 360 mm/sec inforward movement, depending on magnification, and is fixed at 630 mm/secin backward movement. A main scan line which is orthogonal to thesub-scan direction, along which the optical unit is moved, is read bythe image pickup device at a resolution power of 16 pels/mm while theoptical unit is forwardly moved from the left end to the right end, andthen the optical unit is backwardly moved to the left end to completeone scan cycle. The document may be read while it is moved, so thattotal read time can be reduced.

FIG. 2 shows a block diagram of a circuit for processing an image signalfrom the image pickup device 103. The image signal V_(D) read by theimage pickup device 103 is converted to a 6-bit digital signal by an A/Dconverter 201, which signal is sent to latches 203, 205 and 208, and vialatches 202 and 203 to comparators 204 and 207, in synchronism with asampling clock SCL.

The comparator 204 compares the 6-bit image signal sent from the latch202 with the 6-bit image signal of one clock period earlier sent fromthe latch 203 and supplies a comparison output to an AND gate 206 if thenew image signal sent from the latch 202 is smaller. The AND gate 206sends the comparison output from the comparator 204 to the latch 205 insynchronism with the sampling clock SCL.

The comparator 207 compares the 6-bit image signal sent from the latch202 with the 6-bit image signal of one clock period earlier sent fromthe latch 203 and supplies a comparison output to an AND gate 209 if thenew image signal sent from the latch 202 is larger. The AND gate 209sends the comparison output from the comparator 207 to the latch 208 insynchronism with the sampling clock SCL.

When the latches 205 and 208 receive the comparison outputs, they sendthe image signal supplied from the latch 202 to a CPU 211.

The comparators 204 and 207 receive the image signal from the latches205 and 208, respectively, and compare it with the succeeding imagesignal. If the succeeding image signal is smaller, the latch 205 isupdated to the smaller level and the latch 208 retains the prior level.

In addition to the comparison outputs and the sampling clock SCL, anenable signal EN which indicates an effective period of the image signalfrom the image pickup device 103 is applied to the AND gates 206 and 209so that the comparison results based on the image signal in apredetermined region in each main scan line are sent from the latches205 and 208 to the CPU 211. The CPU 211 reads in the image signals fromthe latches 205 and 208 in synchronism with a main scan linesynchronization signal MS so that it can detect the lowest density level(white peak) of the main scan line from the latch 205 and the highestdensity level (black peak) from the latch 208.

The CPU 211 determines a slicing level by an algorithm to be describedlater based on the white peak and the black peak detected for each lineand sends it to a comparator 210. The comparator 210 compares the imagesignal from the latch 203 with the slicing level from the CPU 211 toproduce a binarized signal VIDEO. Instead of the comparator 210, abinary output ROM may be provided in which the CPU 211 may select apattern of the ROM based on the recognition by the latches 205 and 208,and the pattern may be addressed by data from the latch 203 to producecorresponding binary data. In this case, a half-tone image can bereproduced in binary form by a ROM which contains a dither pattern. Thesignal VIDEO is stored in a line memory of a printer (not shown) whichmodulates a laser beam to print an image. The signal VIDEO may bemodulated and transmitted through a line.

FIG. 3 shows the document sheet placed on the document sheet table 101of the document reader (FIG. 1). Coordinates of four points (X₁, Y₁),(X₂, Y₂), (X₃, Y₃) and (X₄, Y₄) are detected by pre-scanning the opticalsystem, where X is measured in a main scan direction from a referencecoordinate SP on the document sheet table 101 and Y is measured in asub-scan direction. The document sheet cover 110 (FIG. 1) ismirror-surface treated such that the image data from the area outside ofthat in which the document sheet is placed is always black data. Thepre-scan comprises the main scan and the sub-scan to cover the entirearea of the glass surface.

The circuit diagram of FIG. 4 shows logic circuitry to detect thosecoordinates. The image data VIDEO binarized by the pre-scan is suppliedto a shift register 301 eight bits in parallel. At the end of theeight-bit input, a gate circuit 302 checks if all of the eight bits arewhite or not, and if yes, it outputs "1" on a signal line 303 when 8bits of continuous white appears first after the start of scan of thedocument and a flip-flop 304 is set. The flip-flop 304 has been reset byan image leading edge signal VSYNC which is produced upon detection of astart position of the scan of the document. It is kept set until thenext VSYNC appears. When the flip-flop 304 is set, the current contentof a main scan counter 351 (which counts down SLC and is reset by HSYNC)is loaded to a latch 305. This information is the coordinate X₁. Thecurrent content of a sub-scan counter 352 is loaded to a latch 306. Thisinformation is the coordinate Y₁. Thus, P₁ (X₁, Y₁) is determined.

Each time the signal on line 303 is "1", the content of the main scancounter 351 is loaded to a latch 307, and is held in a latch 308 untilthe next 8-bit signal is supplied to the shift register 301. As the datacontained in the main scan counter when the first 8-bit white signalappears is loaded to the latch 308, data in a latch 310 (which is resetto "0" by VSYNC) is compared by comparator 309 with the data received bylatch 308 from the main scan counter. If the data in the latch 308 islarger, the data in the latch 307 (which is the same as that in latch308) is loaded to latch 310. The content of the sub-scan counter 352 isloaded to a latch 311. This is done before the next 8-bit signal issupplied to the shift register 301. In this manner, the data of thelatches 308 and 310 is processed for the entire image area so that themaximum value in the X direction of the document area is left in thelatch 310 and the corresponding Y coordinate is left in the latch 311.This is the coordinate P₂ (X₂, Y₂).

A flip-flop 312 is set when the 8-bit white signal first appears in eachmain scan line. It is reset by a horizontal synchronization signal HSYNC(which is produced in each scan of the document line) and set by thefirst 8-bit white signal and holds it until the next HSYNC. When theflip-flop 312 is set, the content of the main scan counter is loaded toa latch 313 and then to a latch 314 before the next HSYNC appears. Thecontent of the latch 314 is compared with the content of a latch 315 bya comparator 316. The latch 315 contains the maximum value in the Xdirection when VSYNC was produced. If the data in the latch 315 islarger than the data in the latch 314, a signal on line 317 is activeand the data in the latch 314, that is, the data in the latch 313, isloaded to the latch 315. This is done between a period of HSYNC-HSYNC.The above comparison is made for the entire image area so that theminimum value in the X direction of the document coordinate is left inthe latch 315. This is X₃. When the signal 317 is produced, the value ofthe sub-scan is loaded to a latch 318. This is Y₃.

Each time the 8-bit white signal appears, the current content of themain scan counter and the current content of the sub-scan counter areloaded to the latches 319 and 320, respectively. As a result, at the endof the pre-scan of the document, the counts when the last 8-bit whitesignal appeared are left in the counters. This is (X₄, Y₄).

The data lines of the eight latches (306, 311, 320, 318, 305, 310, 315and 319) are connected to the bus line BUS of the CPU of FIG. 2 so thatthe CPU reads in those data at the end of the pre-scan.

FIG. 5 shows a flow chart of the document read sequence. A programtherefore is contained in the ROM of FIG. 2 and executed by the CPU.

In a step 501, the optical system forwardly scans from the left end tothe right end of FIG. 1 to detect the coordinates of the document sheeton the document sheet table as shown in FIG. 4.

In a step 502, the area for sampling the peak value to determine theslicing level for the binarization is calculated based on the coordinatedata detected in the step 501. For example, based on the coordinatedetected for the document shown by a hatched area in FIG. 3, arectangular area defined by Y₃, Y₂, X₁ and X₄ is selected as the areafor sampling the peak value. The document sheet is usually placed asnearly parallel as possible to the document sheet table, and even if itis placed obliquely as shown in FIG. 3, there is no possibility thatundesired information from outside of the document will be picked up.The sampling area may be determined using other methods. FIG. 6 shows ascan path. At the end of the document coordinate detection, the opticalsystem is at Ymax in the sub-scan direction. Since the start point Y₂for sampling the peak and the end point Y₃ are known, an executionschedule for steps 504, 505 and 506 can be established. In a step 503,the backward scan is started and the CPU 211 counts the main scan linesynchronization signals, corresponding in number to a distance Ymax-Y₂,and then starts to detect the white peak/black peak, then counts themain scan line synchronization signals, corresponding in number to adistance Y₂ -Y₃, and then completes the peak detection. Then, it countsthe main scan line synchronization signals, corresponding in number to adistance Y₃, and then stops the backward scan.

In the step 504, at the start of the peak detection, the enable signalEN is set in accordance with the detected coordinates X₁ and X₄ as shownin FIG. 6.

In this manner, the white peak and the black peak of the image densityin each main scan line of the document placed at any position on thedocument sheet table can be detected.

An algorithm for determining the slicing level for the binarization isnow explained.

The CPU 211 reads in the black peak and the white peak of each main scanline in the document area and stores then in the RAM.

The black peak BPi and the white peak WPi on the i-th main scan linehave a relationship of BPi≧WPi and assume values between 00 (HEX) and 3F(HEX) because the image data are 6-bit data.

The RAM has the 64×2-byte black peak histogram area and the 64×2-bytewhite peak histogram area, and stores frequencies of BPi, WPi eachhaving 64 stepped levels in an area thereof corresponding to the level.The CPU increments the contents (or frequencies) of the 2-byte areas forthe detected BPi and WPi, waits for the next main scan linesynchronization signal MS, then reads in the data BPi+1 and WPi+1 of the(i+1)th line and again increments the frequencies in the correspondinghistogram areas, and continues the above operation until the end of thesampling in the step 505.

The detected BPi and WPi are not necessarily used as the histogram data.For example, if a band of a uniform density, whether it is white orblack or other density, exists in the direction of the main scan line,the samples BPi and WPi therefrom are substantially equal and they arenot appropriate for the binarization information for discriminating theinformation from the background. Accordingly, if BPi-WPi≦α, the CPU doesnot use them as histogram data but discards them and waits for BPi+1 andWPi+1. The constant α is experimentarily determined and it may be 4 or3, for example. Before the start of the sampling in the step 504, allhistogram area bytes (64×2×2 bytes) are cleared to zero.

As a result, at the end of the sampling in the step 505, histograms forthe black peak and the white peak are constructed as shown in FIG. 7.After the sampling, the optical system is returned to the startposition. At the end of the backward scan in the step 506, the slicinglevel is set in the step 507.

Density levels indicating the peaks of the histograms are taken asrepresentatives. Thus, count results relating to the respective levelsof the histogram are compared with each other so that the density levelhaving the maximum count result is taken as the maximum frequency level.

In the example shown in FIG. 7, the density of the document informationarea is 36H and the density of the document background area is OAH, andan intermediate density 20H is taken as the slicing level.

The slicing level may be determined by the frequency of occurrence ofother levels of the read data. In addition to the slicing level, adither pattern stored in the ROM or an output pattern may be selected Aγ-conversion characteristic for tonality correction may be selected, orthe intensity of an exposure lamp may be adjusted to control the densityof a copy. If the black peak and the white peak are in the vicinity of1F, it indicates that many half-tone areas are included and γ isselected to produce a high quality of image. The detected slicing level,peaks or the distribution of FIG. 7 may be displayed.

Finally, the document is scanned in the step 508 to complete theoperation.

When the same document is continuously scanned a plurality of times tomake a plurality of copies, the slicing level and the ROM pattern thusobtained are held and, after the plurality of copies are made, they arecancelled. When a new document is to be scanned, the slicing level andthe ROM pattern are cancelled and the new pre-scan is carried out. Thepre-scan may be selectively carried out as required. The pre-scan may beomitted to increase the copy speed.

In an embodiment shown in FIG. 8, a document sheet 601 is automaticallyset on a glass 101 by a belt 600, and it is automatically ejected afterreading. A scan unit 200 is positioned at A and the document sheet 601is moved by the belt so that it is set at an exposure position, and thedocument is read while the scan unit 200 is stationary. An areanecessary to determine width and length of the document sheet isdetermined from the read data. The scan unit is moved backward (to theleft in FIG. 8) from position A and the document level is determined.When the scan unit reaches the left end, it starts the forward movementand the binarization is effected based on the level recognition of thenecessary and effective document area.

If the binarization based on the recognition is not required, the dataread from the moving document while the scan unit is stopped at A may bebinarized by a predetermined slicing level so that the read time can bereduced.

What I claim is:
 1. An image processing apparatus comprising:readingmeans for reading an original document to produce an image signal, saidreading means being capable of reading a plurality of pixels in a mainscan direction; scanning means for reciprocatingly scanning the originaldocument by relatively reciprocating said reading means in a sub-scandirection; recognizing means for discriminating between (1) a first areawhere the original document is present and (2) a second area where thedocument is not present, on the basis of the image signal from saidreading means; detecting means for detecting an image density level inthe first area; and conversion means for converting the image signalsfrom said reading means into reproduction signals on the basis of theimage density level detected by said detecting means, wherein saidrecognizing means recognizes the first area on the basis of the imagesignal obtained from said reading means while said scanning means movessaid reading means forward, and said detecting means detects an imagedensity level on the basis of the image signal in the first areaobtained from said reading means while said scanning means moves saidreading means backward.
 2. An image processing apparatus according toclaim 1, wherein said recognizing mean recognizes the area where theoriginal document is present by identifying coordinates where anoriginal document is present.
 3. An image processing apparatus accordingto claim 1, wherein said detecting means detects an image density levelon the basis of the maximum and minimum values of the image signal. 4.An image processing apparatus according to claim 1, wherein saiddetecting means detects an image density level in the rectangular arearecognized by said recognizing means.
 5. An image processing apparatusaccording to claim 1, wherein said conversion means processes the imagesignal on the basis of the frequency of the image density levels.
 6. Animage processing apparatus according to claim 1, wherein said conversionmeans forms a reference signal for quantization and quantizes the imagesignal on the basis of the reference signal.